<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{php echo getSite('site_name');}</title>
    <link rel="stylesheet" href="{KB_WEB_FRONT_CSS}/layui.css">
    <link rel="stylesheet" href="{KB_WEB_FRONT_CSS}/style.css">

    <script src="{KB_WEB_FRONT_JS}/require.js"></script>

    <script type="text/javascript">
        //统一配置文件
        require.config({
            baseUrl: "{KB_WEB_FRONT_JS}",
            paths: {
                "jquery": 'jquery.min',

                "layui": 'layui',
                "common": 'common',
                'clipboard': 'clipboard.min',
                'lightbox': '../../back_end/js/lightbox/js/lightbox',
                'sidebar-menu': 'sidebar-menu/sidebar-menu'
            },
            shim: {
                "common":{
                    deps:['jquery']
                },
                "layui":{
                    exports: 'layui'
                },
                'clipboard':{
                    deps: ['jquery']
                },
                'lightbox': {
                    deps: ['jquery']
                },
                'sidebar-menu': {
                    deps: ['jquery', 'css!sidebar-menu.css', 'css!../js/sidebar-menu/font-awesome.css']
                }
            },
            map: {'*': {'css': 'require-css'}},
            urlArgs: "v=static",
            waitSeconds: 0,//在加载脚本之前要等待的秒数
        });
        require(['jquery', 'layui'], function ($, layui) {
            var LayuiDir = "{KB_WEB_FRONT_JS}";
            layui.config({dir: LayuiDir+'/'});
        });

    </script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><img src="{php echo getSite('site_logo') ? tomedia(getSite('site_logo')) : KB_WEB_BACK_IMG . '/logo.png'}" alt="" ><span>{php echo getSite('site_name')}</span></div>

        {if $_GPC['do'] == 'service' && (in_array($_GPC['act'], array('knowledge', 'orders', 'question')))}
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item {if $_GPC['act'] == 'knowledge'}layui-this{/if}"><a href="{php echo $this->createWebUrl('service', array('act' => 'knowledge'));}">知识库</a></li>
            <li class="layui-nav-item {if $_GPC['act'] == 'orders'}layui-this{/if}"><a href="{php echo $this->createWebUrl('service', array('act' => 'orders'));}">工单管理</a><span class="layui-badge">{$unreply_num}</span></li>
            <li class="layui-nav-item {if $_GPC['act'] == 'question'}layui-this{/if}"><a href="{php echo $this->createWebUrl('service', array('act' => 'question'));}">常见问题</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;" class="exit" onclick='loginout("{php echo $this->createWebUrl('service', array('act' => 'loginout'));}");'>
                    <img src="{if $_SESSION['userinfo']}{$_SESSION['userinfo']['avatar']}{else}{NO_AVATAR}{/if}" class="layui-nav-img">
                    退出登录{$_W['openid']}
                </a>
            </li>
        </ul>
        {/if}
    </div>